RP2040 Hardware API

void busy_wait_us (uint64_t delay_us)
 
Description : Busy wait wasting cycles for the given (64 bit) number of microseconds.   
Parameters :
 delay_us : delay amount in microseconds  
Returns :  None 
Note : 
<テスト結果>  
① 1μsecオン、1μsecオフのLチカ
  LED_PIN 出力電圧
 縦軸 [1v/div]、 横軸[500nsec/div] 
int main()
{
    init(); //初期化
    while(1)
    {
        gpio_put(LED_PIN, 1);   //LED: 点灯
        busy_wait_us (1);
           
        gpio_put(LED_PIN, 0);   //LED: 消灯
        busy_wait_us (1);
    }
    return 0;
}
② 1msecオン、1msecオフのLチカ
  LED_PIN 出力電圧

 縦軸 [1v/div]、 横軸[500μsec/div] 
int main()
{
    init(); //初期化
    while(1)
    {
        gpio_put(LED_PIN, 1);   //LED: 点灯
        busy_wait_us (1000);
           
        gpio_put(LED_PIN, 0);   //LED: 消灯
        busy_wait_us (1000);
    }
    return 0;
}
③ 1secオン、1secオフのLチカ
  LED_PIN 出力電圧

 縦軸 [1v/div]、 横軸[500msec/div] 
int main()
{
    init(); //初期化
    while(1)
    {
        gpio_put(LED_PIN, 1);   //LED: 点灯
        busy_wait_us (1000000);
           
        gpio_put(LED_PIN, 0);   //LED: 消灯
        busy_wait_us (1000000);
    }
    return 0;
}
   
void busy_wait_ms (uint32_t delay_ms)
 
Description : Busy wait wasting cycles for the given number of milliseconds.  
Parameters :
 delay_ms : delay amount in milliseconds
Returns : None
Note :